-
Notifications
You must be signed in to change notification settings - Fork 969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release database emulator v4.2.0 #1564
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Forgot to update the storage url. |
|
Modified the functions emulator to use the new endpoint, then tested with these functions: const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
exports.helloWorld = functions.https.onRequest(async (request, response) => {
await admin.database().ref('test/test1').set({ hello: 'world '});
await admin.database().ref('test/test2').set({ hello: 'other' });
response.send("Hello from Firebase!");
});
exports.databaseOne = functions.database.ref('test/test1').onWrite((change, ctx) => {
console.log('DB1');
return true;
});
exports.databaseTwo = functions.database.ref('test/test2').onWrite((change, ctx) => {
console.log('DB2');
return true;
}); Got this result: $ npx firebase emulators:start
i Starting emulators: ["functions","database"]
⚠ Your requested "node" version "8" doesn't match your global version "10"
✔ functions: Emulator started at http://localhost:5001
i database: Emulator logging to database-debug.log
✔ database: Emulator started at http://localhost:9000
i database: For testing set FIREBASE_DATABASE_EMULATOR_HOST=localhost:9000
i functions: Watching "/tmp/tmp.ddVISM2wPN/functions" for Cloud Functions...
✔ functions[helloWorld]: http function initialized (http://localhost:5001/fir-dumpster/us-central1/helloWorld).
✔ functions[databaseOne]: database function initialized.
✔ functions[databaseTwo]: database function initialized.
✔ All emulators started, it is now safe to connect.
i functions: Beginning execution of "helloWorld"
i functions: Finished "helloWorld" in ~1s
i functions: Beginning execution of "databaseTwo"
i functions: Beginning execution of "databaseOne"
> DB1
i functions: Finished "databaseOne" in ~1s
> DB2
i functions: Finished "databaseTwo" in ~1s |
samtstern
approved these changes
Jul 30, 2019
You'll want to sync your branch w/ |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Database emulator release for function triggers upsert endpoint.